﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Threading;

namespace UI_Layer.Pages
{
    /// <summary>
    /// Interaction logic for CreditCardPay.xaml
    /// </summary>
    public partial class CreditCardPay : Page
    {
        public CreditCardPay()
        {
            InitializeComponent();
            AmountToPayLabel.Content = BookingDetailsCreate.getPayAmount + " RON";

            DispatcherTimer timer = new DispatcherTimer(new TimeSpan(0, 0, 1), DispatcherPriority.Normal, delegate
            {
                this.CreditCardPay_clock_label.Content = DateTime.Now.ToString("HH:mm:ss");
            }, this.Dispatcher); 

            CreditCardType.ItemsSource = creditCardType();
            ExpMonth.ItemsSource = expMonth();
            ExpYear.ItemsSource = expYear();
        }

        private string[] creditCardType()
        {
            string[] strArray =
            {
                "Visa", "Visa Electron", "MasterCard", "American Express"
                
            };
            return strArray;
        }

        private string[] expMonth()
        {
            string[] strArray =
            {
                "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"
                
            };
            return strArray;
        }

        private string[] expYear()
        {
            string[] strArray =
            {
                "2013", "2014", "2015", "2016", "2017", "2018", "2019", "2020"
                
            };
            return strArray;
        }

        private void ButtonClick_SimulateCreditCardPay(object sender, RoutedEventArgs e)
        {
            Confirmation.createBooking();
            Confirmation confirmationpage = new Confirmation();            
            NavigationService navservice = NavigationService.GetNavigationService(this);
            navservice.Navigate(confirmationpage);
        }

        private void ButtonClick_GoBack(object sender, RoutedEventArgs e)
        {
            NavigationService.GoBack();
        }
    }
}
